//
//  AXHomeNzscSecondCollectionCell.m
//  AnXin100
//
//  Created by 天质弘耕 on 2018/10/23.
//  Copyright © 2018年 tzhg. All rights reserved.
//

#import "AXHomeNzscSecondCollectionCell.h"
#import "UIView+SDAutoLayout.h"
#import "ZXCategories.h"

@implementation AXHomeNzscSecondCollectionCell

- (id)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        
        [self creatView];
        [self setlayout];
        
        
    }
    return self;
}

- (void)creatView {
    
  
    
    /** imageview */
    self.storeImageView = [[UIImageView alloc]init];
    self.storeImageView.image = [UIImage imageNamed:@"pt"];
    self.storeImageView.contentMode =UIViewContentModeScaleToFill;
    self.storeImageView.clipsToBounds = YES;
    [self.contentView addSubview:self.storeImageView];
    /** title */
    self.storeNameLabel = [[UILabel alloc]init];
    self.storeNameLabel.font = FONT_TWELVE;
    self.storeNameLabel.text = @"云南夏黑葡萄 新鲜无籽提 子水果";
    self.storeNameLabel.textColor = COLOR_DIV;
    self.storeNameLabel.textAlignment = NSTextAlignmentCenter;
    [self.contentView  addSubview:self.storeNameLabel];
    /** 价格 */
    self.priceLabel = [[UILabel alloc]init];
    self.priceLabel.textAlignment = NSTextAlignmentCenter;
    self.priceLabel.font = FONT_TWELVE;
    self.priceLabel.textColor = COLOR_ORG;
    self.priceLabel.text = @"¥44/kg";
    [self.contentView  addSubview:self.priceLabel];
    
    
   
    
}

- (void)setlayout {
    
   
    
    /** 店铺图片 */
    self.storeImageView.sd_layout
    .leftSpaceToView(self.contentView, 0)
    .topSpaceToView(self.contentView,10)
    .widthIs((SCREEN_WIDTH-30)/2.0)
    .heightIs((SCREEN_WIDTH-30)/2.0/131*90);
    /** 店铺名字 */
    self.storeNameLabel.sd_layout
    .leftSpaceToView(self.contentView, 0)
    .topSpaceToView(self.storeImageView,0)
    .widthIs((SCREEN_WIDTH-30)/2)
    .autoHeightRatio(0)
    .minHeightIs(30);
    /** 价格 */
    self.priceLabel.sd_layout
    .leftSpaceToView(self.contentView, 0)
    .topSpaceToView(self.storeNameLabel,0)
    .widthIs((SCREEN_WIDTH-30)/2)
    .heightIs(30);
    
    
    

    
    
}

- (void)tapPraise:(UIButton *)btn {
    
}

@end
